package terminal;

public abstract class TerminalHandler {
	private static ITerminal experimentalTerminal;
	private static ITerminal defaultTerminal;
	public static ITerminal getTerminal(){
		switch(core.Constants.connectionState){
		case DISCONNECTED:
			if(experimentalTerminal == null)
				experimentalTerminal = new ExperimentalTerminal();
			return experimentalTerminal;
		case CONNECTED:
			if(defaultTerminal == null)
				defaultTerminal = new DefaultTerminal();
			return defaultTerminal;	
		default:
			if(defaultTerminal == null)
				defaultTerminal = new DefaultTerminal();
			return defaultTerminal;	
		}

	}
}
